
analogueCheck = () -> (
     
     R=QQ[a,b,c,e,f,m, x,y,z,t, Degrees=>{0,0,0,0,0,0,1,1,1,1}]; -- Ring of homogeneous coordinates.
     
     quintic=(x+m*y+a*z)^2*t^3+(a^2*x^3+x*y*(b*x+c*y)+m^2*y^3+(e*x^2+f*x*y+c*y^2)*z+(b*x+e*y)*z^2+z^3)*t^2+(2*a*x^3*y+e*x^2*y^2+2*a*m*x*y^3+(2*a*m*x^3+f*x^2*y+f*x*y^2+2*m*y^3)*z+(c*x^2+f*x*y+b*y^2)*z^2+2*(m*x+a*y)*z^3)*t+x^3*y^2+a^2*x^2*y^3+x*y*z*(2*m*x^2+b*x*y+2*a*y^2)+z^2*(m^2*x^3+c*x^2*y+e*x*y^2+y^3)+(m*x+a*y)^2*z^3;
     
     myquintic = sub(quintic, {t=>1, x=>x-m*y-a*z}); -- dehomogenize and make quadratic part square of linear term.

     q3 = part(3, sub(myquintic, x=>0));
     
     gamma = diff(z^3, q3)/6;

     g1 = diff(y^3,q3)/6;
     g2 = diff(z*y^2, q3)/2;     
     g3 = diff(y*z^2, q3)/2;
       
     blowup = sub(sub(myquintic,{x=>x*y,z=>z*y})/y^2,R); -- Blowup in the direction of y.
       
     f2 = part(2,blowup); -- Quadratic part after the blowup.
     f3 = part(3,blowup); -- Cubic part after the blowup.
     
     g4 = -((diff(x*y,f2))^2 - (diff(x^2,f2))*(diff(y^2,f2)));
          
     mu = diff(x*y, f2)/2;
     
     ff2 = sub(f2, x => -mu*y);
     ff2 = ff2*4;
     
     ff3 = sub(f3, x => -mu*y);
     ff3 = ff3*4;
     
     gg5 = (-1)*(diff(y^3, ff3)/6);
     
     g5 = (gg5 + 3*g4*m*a^2 - g4*b)/4;
     
     g6 = diff(z*y^2,ff3)/4;
         
    )

rSolve = () -> (
     
     R=QQ[a,b,c,e,f,m, x,y,z,t, Degrees=>{0,0,0,0,0,0,1,1,1,1}]; -- Ring of homogeneous coordinates.
     
     quintic=(x+m*y+a*z)^2*t^3+(a^2*x^3+x*y*(b*x+c*y)+m^2*y^3+(e*x^2+f*x*y+c*y^2)*z+(b*x+e*y)*z^2+z^3)*t^2+(2*a*x^3*y+e*x^2*y^2+2*a*m*x*y^3+(2*a*m*x^3+f*x^2*y+f*x*y^2+2*m*y^3)*z+(c*x^2+f*x*y+b*y^2)*z^2+2*(m*x+a*y)*z^3)*t+x^3*y^2+a^2*x^2*y^3+x*y*z*(2*m*x^2+b*x*y+2*a*y^2)+z^2*(m^2*x^3+c*x^2*y+e*x*y^2+y^3)+(m*x+a*y)^2*z^3;
    
     myquintic = sub(quintic, {t=>1, x=>x-m*y-a*z}); -- dehomogenize and make quadratic part square of linear term.
     
     g1 = -a^2*m^3+b*m^2-c*m+m^2;
     g2 = -3*a^3*m^2+2*a*b*m+e*m^2-a*c-f*m+c;
     g3 = -3*a^4*m+a^2*b+2*a*e*m-a*f-b*m+e;
     g4 = -9*a^4*m^4+12*a^2*b*m^3-6*a^2*c*m^2-4*b^2*m^2-8*a*m^3+4*b*c*m-8*a*m^2+4*e*m^2-c^2;
     g5 = 3*a^3*m^4-3*a^3*m^3-4*a*b*m^3-a^2*m^2+3*a*c*m^2+b*e*m^2+a*c*m-c*e*m+m^3;
     g6 = -18*a^5*m^3+18*a^3*b*m^2+6*a^2*e*m^3-6*a^3*c*m-3*a^2*f*m^2-4*a*m^4-4*a*b^2*m-12*a^2*m^2-4*b*e*m^2+2*a*b*c-4*a^2*m+4*a*e*m+2*c*e*m+2*b*f*m+2*f*m^2-c*f-2*f*m+4*m;
     
     B = -sub(g1, {b=>0})/diff(b,g1);
     g1 = numerator(sub(g1,b=>B));
     g2 = numerator(sub(g2,b=>B));
     g3 = numerator(sub(g3,b=>B));
     g4 = numerator(sub(g4,b=>B));
     g5 = numerator(sub(g5,b=>B));
     g6 = numerator(sub(g6,b=>B));
     
     F = -sub(g2, {f=>0})/diff(f,g2);
     g2 = numerator(sub(g2,f=>F));
     g3 = numerator(sub(g3,f=>F));
     g4 = numerator(sub(g4,f=>F));
     g5 = numerator(sub(g5,f=>F));
     g6 = numerator(sub(g6,f=>F));
     
     C = -sub(g3, {c=>0})/diff(c,g3);
     g3 = numerator(sub(g3,c=>C));
     g4 = numerator(sub(g4,c=>C));
     g5 = numerator(sub(g5,c=>C));
     g6 = numerator(sub(g6,c=>C));
     
     E = -sub(g5, {e=>0})/diff(e,g5);
     g4 = numerator(sub(g4,e=>E));
     g5 = numerator(sub(g5,e=>E));
     g6 = numerator(sub(g6,e=>E));
     
     B2 = numerator(sub(numerator(B),m=>(4/a^2)));
     C2 = numerator(sub(numerator(C),m=>(4/a^2)));
     E2 = numerator(sub(numerator(E),m=>(4/a^2)));
     F2 = numerator(sub(numerator(F),m=>(4/a^2)));
     
     E3 = E2;
     C3 = sub(C2, e=>E3);
     B3 = sub(B2, c=>C3);
     F3 = sub(F2, {c=>C3, e=>E3});
     
     )

